package com.jiangwz.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jiangwz.properties.ConfigProperties;

/**
 * @author jiangwz
 * @create 2019/1/25.
 */
@RestController()
public class HelloController {

    @Autowired
    private ConfigProperties configProperties;

    @GetMapping("/say/{str}")
    public Object sayHello(@PathVariable String str){
        return "Hi: "+ str;
    }


    @RequestMapping("hello")
    public String hello(){
        return "hello world";
    }

    @RequestMapping("prop")
    public String pro(){
        System.out.println(configProperties.getName());
        System.out.println(configProperties.getPort());
        return "ok";
    }
}
